#include <Arduino.h>

class DigitalTube {
public:
    DigitalTube(const uint8_t (&pos_pins)[8], const uint8_t (&neg_pins)[3]);

    void begin();

    /**
     * \brief 点亮某一个数码管中的led
     *
     * \param index 点亮哪一个数码管
     * \param ch 点亮哪些LED
     */
    bool lit(uint8_t index, char ch);

private:
    static uint8_t get_seg7(char ch);
    uint8_t pos_pins[8];
    uint8_t neg_pins[3];

};
